<?php

declare(strict_types=1);

namespace App\Request\User;

use Hyperf\Validation\Request\FormRequest;

class UserCardCancellationRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'card_no' => 'required',
            'amount' => 'required',
            'account_id' => 'required',
            'save_date' => 'required',
            'cate_id' => 'required'
        ];
    }

    public function messages(): array
    {
        return [
            'card_no.required' => '请输入会员卡号',
            'amount.required' => '请输入会员卡金额',
            'account_id.required' => '动账账号缺失',
            'cate_id.required' => '请选择消费类目'
        ];
    }
}
